<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('菜房出库单详情列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row" id="printArea">
        <!-- <div class="col-sm-12 search-collapse">

             <div class="btn-group-sm" id="toolbar1" role="group">

                 <h3 class="inline">出库单号</h3>

             </div>
         </div>-->
        <div class="col-sm-12 search-collapse">

            <form id="formId">
                <input type="hidden" name="orderId" th:value="${orderId}">
                <div class="select-list">

                    <ul>
                        <!-- <li>
                             <h3 class="inline">订单编号：</h3>
                         </li>
 -->
                        <li>
                            出库类型： <select name="outputType" th:with="type=${@dict.getType('cforderType')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                                    th:selected="${dict.dictValue == workType}"></option>

                        </select>
                        <li class="select-time">
                            <label>入库时间： </label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginTime]" lay-key="1" th:value="${beginxdTime}">
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"
                                   lay-key="2" th:value="${endxdTime}">
                        </li>

                        <li>
                            出库经手人：<input type="text" name="inputUser"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="btn-group-sm" id="toolbar" role="group">
            <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ncOuputCf:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="system:ncOuputCf:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:ncOuputCf:remove">
                <i class="fa fa-remove"></i> 删除
            </a>-->
            <a class="btn btn-warning" onclick="$.table.exportExcel()">
                <i class="fa fa-download"></i> 导出
            </a>
            <a class="btn btn-warning" id="print-btn" orderType="8">
                <i class="fa fa-download"></i> 打印
            </a>
        </div>
        <h3 align="center"><span th:text="出库单" id="ordercode" hidden="hidden"></span></h3>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
            <h3><span class="fl-l" id="autograph" hidden="hidden"></span></h3>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncOuputCf:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncOuputCf:remove')}]];
    var prefix = ctx + "system/ncOuputCf";
    var datas = [[${@dict.getType('cforderType')}]];
    $(function () {
        var options = {
            url: prefix + "/list?type=-1&orderId=" + [[${orderId}]],
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export?type=-1&orderId="+[[${orderId}]],
            modalName: "菜房出库",
            showExport: false,
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            columns: [{
                title: '序号',
                formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }
            },
                {
                    field: 'outputId',
                    title: '出库id',
                    visible: false
                },
                {
                    field: 'ncorderCf.cforderCode',
                    title: '订单编号',
                    formatter: function (value, row, index) {
                        if (row.ncorderCf.isCheck == '1') {
                            return '--'
                        } else {
                            return row.ncorderCf.cforderCode
                        }

                    }

                }, {

                    field: 'piciCode',
                    title: '蔬菜批次',
                },
                {
                    field: 'ncorderCf.cropNameCn',
                    title: '作物名称',
                },
                {
                    field: 'ncorderCf.cropVarietiesCn',
                    title: '作物品种',
                },
                {
                    field: 'teamCn',
                    title: '生产班组',

                },
                {

                    field: 'outputType',
                    title: '出库类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'realAmout',
                    title: '实际提供数量（kg）',
                    sortable: true
                },
                {
                    field: 'outputTime',
                    title: '出库时间',
                    sortable: true
                },
                {
                    field: 'outputUser',
                    title: '出库经手人',
                    sortable: true
                },

                {
                    field: 'remark',
                    title: '备注',
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outputId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.outputId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);

        $('.top-link').click(function () {
            var index = $(this).index();
            switch (index) {
                case 0:
                    window.location.href = ctx + 'system/ncOrderCf/ncOrderCf-ordered?status=2';
                    return;
                case 1:
                    window.location.href = ctx + 'system/ncInputCf';
                    return;
                case 2:
                    window.location.href = ctx + 'system/ncInputCf/ncInputCf-stock';
                    return;
                case 3:
                    window.location.reload();

                    return;
            }
        })
    });
</script>
</body>
</html>